package com.and.bean;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.compass.annotations.Searchable;
@Entity
@Searchable(root = false)
public class Participle implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2033730256427206991L;

	private Integer id;
	private String speech;// 如：你好，中国，人民
	private long amount;
	private ParticipleCategory participleCategory;
	private Set<Suggestion> suggestion;
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(length = 1000, nullable = false)
	public String getSpeech() {
		return speech;
	}

	public void setSpeech(String speech) {
		this.speech = speech;
	}

	
	
	public long getAmount() {
		return amount;
	}

	public void setAmount(long amount) {
		this.amount = amount;
	}

	@ManyToOne(cascade = { CascadeType.REMOVE, CascadeType.REFRESH })
	@JoinColumn(name = "participleCategory")
	public ParticipleCategory getParticipleCategory() {
		return participleCategory;
	}

	public void setParticipleCategory(ParticipleCategory participleCategory) {
		this.participleCategory = participleCategory;
	}
	@OneToMany(mappedBy = "participle",cascade={CascadeType.PERSIST, CascadeType.MERGE})
	public Set<Suggestion> getSuggestion() {
		return suggestion;
	}

	public void setSuggestion(Set<Suggestion> suggestion) {
		this.suggestion = suggestion;
	}
	
	

}
